export const columnsTitle = vm => {
  const columnsList = [
    {
      type: 'index',
      minWidth: 50,
      fixed: 'left',
      index: index => index + 1 + (vm.pagingInfo.curr_page - 1) * vm.pagingInfo.page_size,
    },
    { type: 'selection', fixed: 'left', minWidth: 50 },
    {
      title: '仓库',
      key: 'code',
      align: 'left',
      minWidth: 250,
    },

    {
      title: '创建类型',
      key: 'create_type',
      minWidth: 150,
      render: (h, row) => {
        const { create_type } = row
        // 1：手动创建   2：平台推 -
        let val = ''
        switch (String(create_type)) {
          case '1':
            val = '手动创建'
            break

          case '2':
            val = '平台推'
            break

          default:
            break
        }
        return h('span', val)
      },
    },
    {
      title: '订单类型',
      key: 'order_type',
      minWidth: 150,
      render: (h, row) => {
        const { order_type } = row
        // 1:一件代发发的订单，2:转运的订-
        let val = ''
        switch (String(order_type)) {
          case '1':
            val = '一件代发发的订单'
            break

          case '2':
            val = '转运的订单'
            break

          default:
            break
        }
        return h('span', val)
      },
    },
    {
      title: '运输方式',
      key: 'ship_type',
      minWidth: 150,
      render: (h, row) => {
        const { ship_type } = row
        // 0:公路运输,1:铁路运输,2:水路运输,3:航空运输,4:管道运输
        let val = ''
        switch (String(ship_type)) {
          case '0':
            val = '公路运输'
            break

          case '1':
            val = '铁路运输'
            break

          case '2':
            val = '水路运输'
            break
          case '3':
            val = '航空运输'
            break
          case '4':
            val = '管道运输'
            break

          default:
            break
        }
        return h('span', val)
      },
    },

    {
      title: '币种',
      key: 'container_type',
      minWidth: 150,
      render: (h, row) => {
        const { container_type } = row
        // 0:人民币，1：美元，2：欧元，3：英镑，4:日元)
        let val = ''
        switch (String(container_type)) {
          case '0':
            val = '人民币'
            break

          case '1':
            val = '美元'
            break

          case '2':
            val = '欧元'
            break

          case '3':
            val = '英镑'
            break

          case '4':
            val = '日元'
            break

          default:
            break
        }
        return h('span', val)
      },
    },

    {
      title: '收件人',
      key: 'receiver',
      minWidth: 150,
    },
    {
      title: '收件地址',
      key: 'address',
      minWidth: 150,
    },
  ]
  return columnsList
}
